package com.xmu.prcs.dao;

import java.util.List;

import com.xmu.prcs.entity.Post;

/**
 * 
 * @author frequent
 * @version 1.0,2010-3-20
 *
 */
public interface PostDao extends GenericDao<Post>{

	public final String ID_POST = "idPost";
	public final String AUTHER_NAME = "autherName";
	public final String POST_NAME = "postName";
	public final String REPLY_NUMBER = "replyNumber";
	public final String BROWSE_NUMBER = "browseNumber";
	public final String CREATE_TIME = "createTime";
	public final String LAST_REPLY_USER_NAME = "lastReplyUserName";
	public final String LAST_REPLY_TIME = "lastReplyTime";
	
	/**
	 * 得到某个话题下的最新的帖子
	 * @param topicId
	 * @return
	 */
	public Post getLastestPostOfTopic(int topicId);
	
	/**
	 * 按某个属性值查找话题
	 * @param property
	 * @param object
	 * @return
	 */
	public List<Post> getByProperty(String property, Object object);
	
	/**
	 * 得到帖子总数
	 * @return
	 */
	public int countPost(int topicId);
	
	/**
	 * 按分页效果得到帖子
	 * @param begin
	 * @param size
	 * @return
	 */
	public List<Post> find4Page(int begin, int size, int topicId);
}
